package com.zhaoyu.user.controller;

import com.zhaoyu.apis.user.ApUserLoginControllerApi;
import com.zhaoyu.model.common.dtos.ResponseResult;
import com.zhaoyu.model.user.dtos.LoginDto;
import com.zhaoyu.user.service.ApUserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class ApUserLoginController implements ApUserLoginControllerApi {

    @Autowired
    private ApUserLoginService apUserLoginService;

    @Override
    @PostMapping("/in") // json格式的数据
    public ResponseResult loginApUser(@RequestBody LoginDto loginDto) {
        return apUserLoginService.login(loginDto);
    }

}